<template>
  <div class="logo">
    <router-link :to="{path:'/'}">
      <!-- <LogoSvg alt="logo" /> -->
      <!-- <img class="logoImg" :src="Logo" alt="logo" /> -->
      <h1 v-if="showTitle">{{ title }}</h1>
    </router-link>
  </div>
</template>

<script>
import LogoSvg from '@/assets/logo.png'
import LogoSvg3 from '@/assets/logo3.png'

export default {
  name: 'Logo',
  data() {
    return {
      Logo: null
    }
  },
  props: {
    title: {
      type: String,
      default: '',
      required: false
    },
    showTitle: {
      type: Boolean,
      default: true,
      required: false
    }
  },
  created() {
    this.getClientWidth()
    window.addEventListener('resize', this.getClientWidth)
  },
  methods: {
    getClientWidth() {
      // this.Logo = document.documentElement.clientWidth <= 1200 ? LogoSvg3 : LogoSvg
      this.Logo = document.documentElement.clientWidth <= 1200 ? null : null
    }
  }
}
</script>

<style lang="less" scoped="">
// .sider .logo img.logoImg{
//   width: 100%;
//   height: 64px;
// }
</style>
